package com.applink.sell_proof.pojo;

import java.util.ArrayList;


public class GenericObject {
	
	@SuppressWarnings("rawtypes")
	private ArrayList<GenericAttribute> attributeList;
	private String objectName;
	
	@SuppressWarnings("rawtypes")
	public GenericObject(){
		this.attributeList = new ArrayList<GenericAttribute>();
		this.objectName ="";
	}

	@SuppressWarnings("rawtypes")
	public void setAttributeList(ArrayList<GenericAttribute> _attributeList) {
		this.attributeList = _attributeList;
	}

	@SuppressWarnings("rawtypes")
	public ArrayList<GenericAttribute> getAttributeList() {
		return attributeList;
	}
	
	public void setObjectName(String _name){
		this.objectName = _name;
	}
	public String getObjectName(){
		return this.objectName;
	}
	
	public String getContentFromObjectMappingName(String mappingName){
		String content ="";
		
		for(int i=0; i< this.attributeList.size();i++){
			
			@SuppressWarnings("rawtypes")
			GenericAttribute genericAtt = this.attributeList.get(i);
			
			if( genericAtt.getName().toString().compareTo(mappingName) == 0){
				content = String.valueOf(genericAtt.getValue());
			}
			
		}
		return content;
	}
}
